package com.g2room.search.life;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder;
import org.elasticsearch.action.admin.indices.mapping.put.PutMappingRequest;
import org.elasticsearch.client.Requests;
import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentFactory;

public class EsMapping {
	static Map<String, XContentBuilder> builderMap = getMappings();//new HashMap<String, XContentBuilder>();
	static List<String> tns = new ArrayList<String>();
	static {
//		tns.add("nceeArti");
	}
	public static void main(String[] args) {
		String idx = "life";
		initMappingByCreate(idx);
//		initMapping(idx, "sch");
	}
	
	public static void initMapping(String index, String type) {
    	EsClient ec = new  EsClient();
    	ec.init();
    	for(String key : builderMap.keySet()) {
    		if(type.endsWith("*") && key.startsWith(type.replace("*", ""))) {
				XContentBuilder mapping = builderMap.get(key);
				PutMappingRequest mappingRequest = Requests.putMappingRequest(index).type(type).source(mapping);
				ec.getClient().admin().indices().putMapping(mappingRequest).actionGet();
    		}
    	}
    }
    
    public static void initMappingByCreate(String index) {
    	EsClient ec = new  EsClient(index);
    	ec.init();
   	 	CreateIndexRequestBuilder cib = ec.getClient().admin().indices().prepareCreate(index);
   	 	for(String type : builderMap.keySet()) {
	   	 	XContentBuilder mapping = builderMap.get(type);
	   	 	if(null == mapping) {
	   	 		continue;
	   	 	}
	   	 	cib.addMapping(type, mapping);
   	 	}
   	 	
   	 	cib.execute().actionGet();
    }
    
    public static Map<String, XContentBuilder> getMappings() {
    	if(null == builderMap) builderMap = new HashMap<String, XContentBuilder>();
    	try {
    		
//    		builderMap.put("lifeScenery", XContentFactory.jsonBuilder().startObject().startObject("lifeScenery").startObject("properties").startObject("phone").field("type", "string").field("index","not_analyzed").endObject().startObject("cityName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("typeIds").field("type", "string").field("index","no").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("score").field("type", "string").field("index","not_analyzed").endObject().startObject("kindId").field("type", "integer").endObject().startObject("shopHours").field("type", "string").field("index","no").endObject().startObject("cityId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("levelName").field("type", "string").field("index","no").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("rank").field("type", "integer").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("interest").field("type", "string").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("playtime").field("type", "string").field("index","no").endObject().startObject("oldId").field("type", "integer").field("index","no").endObject().startObject("website").field("type", "string").field("index","no").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("cost").field("type", "string").field("index","no").endObject().startObject("categoryIds").field("type", "string").field("index","not_analyzed").endObject().startObject("traffic").field("type", "string").field("index","no").endObject().startObject("provinceName").field("type", "string").field("index","no").endObject().startObject("categoryName").field("type", "string").field("index","no").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("address").field("type", "string").field("index","no").endObject().startObject("ticketPrice").field("type", "string").field("index","no").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("typeName").field("type", "string").field("index","no").endObject().startObject("images").field("type", "string").field("index","no").endObject().startObject("tips").field("type", "string").field("index","no").endObject().startObject("scenery").field("type", "string").field("index","no").endObject().startObject("kindName").field("type", "string").field("index","no").endObject().startObject("coverId").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeFoodShop", XContentFactory.jsonBuilder().startObject().startObject("lifeFoodShop").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("foodName").field("type", "string").field("index","no").endObject().startObject("shopId").field("type", "integer").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("foodId").field("type", "integer").endObject().startObject("oldId").field("type", "integer").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeNews", XContentFactory.jsonBuilder().startObject().startObject("lifeNews").startObject("properties").startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("status").field("type", "integer").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("districtId").field("type", "integer").endObject().startObject("oldTitle").field("type", "string").field("index","no").endObject().startObject("typeId").field("type", "integer").endObject().startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("id").field("type", "integer").endObject().startObject("author").field("type", "string").field("index","no").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("districtName").field("type", "string").field("index","no").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("publishTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").endObject().startObject("coverHeight").field("type", "integer").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("typeName").field("type", "string").field("index","no").endObject().startObject("coverWidth").field("type", "integer").endObject().endObject().endObject().endObject());
//    		builderMap.put("comType", XContentFactory.jsonBuilder().startObject().startObject("comType").startObject("properties").startObject("typeName").field("type", "string").field("index","no").endObject().startObject("id").field("type", "integer").endObject().startObject("area").field("type", "string").field("index","not_analyzed").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("companyNum").field("type", "string").field("index","no").endObject().startObject("typeCode").field("type", "string").field("index","not_analyzed").endObject().endObject().endObject().endObject());
//    		builderMap.put("comMenu", XContentFactory.jsonBuilder().startObject().startObject("comMenu").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("commentNum").field("type", "integer").field("index","no").endObject().startObject("shopId").field("type", "integer").endObject().startObject("shopName").field("type", "string").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().endObject().endObject().endObject());
//    		builderMap.put("dicType", XContentFactory.jsonBuilder().startObject().startObject("dicType").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("level").field("type", "integer").endObject().startObject("sort").field("type", "integer").endObject().startObject("type").field("type", "integer").endObject().startObject("parentId").field("type", "integer").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeComment", XContentFactory.jsonBuilder().startObject().startObject("lifeComment").startObject("properties").startObject("shopId").field("type", "integer").endObject().startObject("flavor").field("type", "string").field("index","not_analyzed").endObject().startObject("kindId").field("type", "integer").endObject().startObject("shopName").field("type", "string").field("index","no").endObject().startObject("id").field("type", "integer").endObject().startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("username").field("type", "string").field("index","not_analyzed").endObject().startObject("environment").field("type", "string").field("index","not_analyzed").endObject().startObject("service").field("type", "string").field("index","not_analyzed").endObject().startObject("images").field("type", "string").field("index","no").endObject().startObject("kindName").field("type", "string").field("index","no").endObject().startObject("head").field("type", "string").field("index","no").endObject().startObject("oldId").field("type", "integer").field("index","no").endObject().startObject("commentTime").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("comShopImgs", XContentFactory.jsonBuilder().startObject().startObject("comShopImgs").startObject("properties").startObject("imgUrl").field("type", "string").field("index","no").endObject().startObject("id").field("type", "integer").endObject().startObject("categoryId").field("type", "integer").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("shopId").field("type", "integer").endObject().startObject("categoryName").field("type", "string").field("index","no").endObject().startObject("shopName").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("sysUser", XContentFactory.jsonBuilder().startObject().startObject("sysUser").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("username").field("type", "string").field("index","not_analyzed").endObject().startObject("type").field("type", "integer").endObject().startObject("password").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeDistrict", XContentFactory.jsonBuilder().startObject().startObject("lifeDistrict").startObject("properties").startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("areaCode").field("type", "string").field("index","no").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("belongToName").field("type", "string").field("index","no").endObject().startObject("code").field("type", "string").field("index","not_analyzed").endObject().startObject("type").field("type", "integer").endObject().startObject("postcode").field("type", "string").field("index","no").endObject().startObject("plateNumber").field("type", "string").field("index","no").endObject().startObject("id").field("type", "integer").endObject().startObject("slogan").field("type", "string").field("index","no").endObject().startObject("levelName").field("type", "string").field("index","no").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("area").field("type", "string").field("index","not_analyzed").endObject().startObject("order").field("type", "integer").field("index","no").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("populationDensity").field("type", "string").field("index","no").endObject().startObject("shortname").field("type", "string").field("index","not_analyzed").endObject().startObject("belongToId").field("type", "integer").endObject().startObject("video").field("type", "string").field("index","no").endObject().startObject("population").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeDriverSchool", XContentFactory.jsonBuilder().startObject().startObject("lifeDriverSchool").startObject("properties").startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("cityName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("phone").field("type", "string").field("index","not_analyzed").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("remarks").field("type", "string").field("index","no").endObject().startObject("cityId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("traffic").field("type", "string").field("index","no").endObject().startObject("provinceName").field("type", "string").field("index","no").endObject().startObject("price").field("type", "string").field("index","no").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("address").field("type", "string").field("index","no").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("reputation").field("type", "string").field("index","not_analyzed").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("feature").field("type", "string").field("index","no").endObject().startObject("priceDate").field("type", "string").field("index","no").endObject().startObject("enrlRange").field("type", "string").field("index","not_analyzed").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeLinkWord", XContentFactory.jsonBuilder().startObject().startObject("lifeLinkWord").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("word").field("type", "string").field("index","no").endObject().startObject("type").field("type", "integer").endObject().startObject("url").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("sysSlide", XContentFactory.jsonBuilder().startObject().startObject("sysSlide").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("position").field("type", "integer").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("status").field("type", "integer").endObject().startObject("imageUrl").field("type", "string").field("index","no").endObject().startObject("url").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("sysArea", XContentFactory.jsonBuilder().startObject().startObject("sysArea").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("sortWord").field("type", "string").field("index","not_analyzed").endObject().startObject("pid").field("type", "integer").endObject().startObject("isrecommend").field("type", "integer").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().endObject().endObject().endObject());
//    		builderMap.put("comCompany", XContentFactory.jsonBuilder().startObject().startObject("comCompany").startObject("properties").startObject("contactor").field("type", "string").field("index","not_analyzed").endObject().startObject("businessScope").field("type", "string").field("index","no").endObject().startObject("phone").field("type", "string").field("index","not_analyzed").endObject().startObject("cityName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("zipCode").field("type", "string").field("index","no").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("companyType").field("type", "string").field("index","not_analyzed").endObject().startObject("kindId").field("type", "integer").endObject().startObject("cityId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("lastUpdate").field("type", "string").field("index","no").endObject().startObject("area").field("type", "string").field("index","not_analyzed").endObject().startObject("createDate").field("type", "string").field("index","no").endObject().startObject("principal").field("type", "string").field("index","not_analyzed").endObject().startObject("companyName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("fax").field("type", "string").field("index","no").endObject().startObject("website").field("type", "string").field("index","no").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("status").field("type", "integer").endObject().startObject("star").field("type", "string").field("index","not_analyzed").endObject().startObject("categoryId").field("type", "integer").endObject().startObject("typeId").field("type", "integer").endObject().startObject("regNum").field("type", "string").field("index","not_analyzed").endObject().startObject("provinceName").field("type", "string").field("index","no").endObject().startObject("categoryName").field("type", "string").field("index","no").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("address").field("type", "string").field("index","no").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("typeName").field("type", "string").field("index","no").endObject().startObject("regCapital").field("type", "string").field("index","no").endObject().startObject("kindName").field("type", "string").field("index","no").endObject().startObject("employees").field("type", "string").field("index","no").endObject().startObject("mobile").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("sysAd", XContentFactory.jsonBuilder().startObject().startObject("sysAd").startObject("properties").startObject("position").field("type", "integer").endObject().startObject("cityName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("updatetime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("status").field("type", "integer").endObject().startObject("type").field("type", "integer").endObject().startObject("url").field("type", "string").field("index","no").endObject().startObject("id").field("type", "integer").endObject().startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("cityId").field("type", "integer").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("provinceName").field("type", "string").field("index","no").endObject().startObject("page").field("type", "integer").endObject().startObject("imageUrl").field("type", "string").field("index","no").endObject().startObject("channel").field("type", "integer").endObject().endObject().endObject().endObject());
//    		builderMap.put("comShop", XContentFactory.jsonBuilder().startObject().startObject("comShop").startObject("properties").startObject("brandStory").field("type", "string").field("index","no").endObject().startObject("cityName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("phone").field("type", "string").field("index","not_analyzed").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("kindId").field("type", "integer").endObject().startObject("shopHours").field("type", "string").field("index","no").endObject().startObject("id").field("type", "integer").endObject().startObject("cityId").field("type", "integer").endObject().startObject("spendPerhead").field("type", "string").field("index","no").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("secondName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("oldId").field("type", "integer").field("index","no").endObject().startObject("tags").field("type", "string").field("index","no").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("star").field("type", "string").field("index","not_analyzed").endObject().startObject("flavor").field("type", "string").field("index","not_analyzed").endObject().startObject("categoryId").field("type", "integer").endObject().startObject("list").field("type", "string").field("index","no").endObject().startObject("typeId").field("type", "integer").endObject().startObject("provinceName").field("type", "string").field("index","no").endObject().startObject("environment").field("type", "string").field("index","not_analyzed").endObject().startObject("districtName").field("type", "string").field("index","no").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("categoryName").field("type", "string").field("index","no").endObject().startObject("address").field("type", "string").field("index","no").endObject().startObject("service").field("type", "string").field("index","not_analyzed").endObject().startObject("typeName").field("type", "string").field("index","no").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("kindName").field("type", "string").field("index","no").endObject().startObject("fullName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeShop", XContentFactory.jsonBuilder().startObject().startObject("lifeShop").startObject("properties").startObject("cityName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("phone").field("type", "string").field("index","not_analyzed").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("kindId").field("type", "integer").endObject().startObject("shopHours").field("type", "string").field("index","no").endObject().startObject("id").field("type", "integer").endObject().startObject("cityId").field("type", "integer").endObject().startObject("spendPerhead").field("type", "string").field("index","no").endObject().startObject("secondName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("oldId").field("type", "integer").field("index","no").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("menu").field("type", "string").field("index","no").endObject().startObject("flavor").field("type", "string").field("index","not_analyzed").endObject().startObject("star").field("type", "string").field("index","not_analyzed").endObject().startObject("typeId").field("type", "integer").endObject().startObject("categoryIds").field("type", "string").field("index","not_analyzed").endObject().startObject("traffic").field("type", "string").field("index","no").endObject().startObject("environment").field("type", "string").field("index","not_analyzed").endObject().startObject("provinceName").field("type", "string").field("index","no").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("categoryName").field("type", "string").field("index","no").endObject().startObject("address").field("type", "string").field("index","no").endObject().startObject("service").field("type", "string").field("index","not_analyzed").endObject().startObject("typeName").field("type", "string").field("index","no").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("kindName").field("type", "string").field("index","no").endObject().startObject("fullName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeCity", XContentFactory.jsonBuilder().startObject().startObject("lifeCity").startObject("properties").startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("phone").field("type", "string").field("index","not_analyzed").endObject().startObject("otherTraffic").field("type", "string").field("index","no").endObject().startObject("taxi").field("type", "string").field("index","no").endObject().startObject("bus").field("type", "string").field("index","no").endObject().startObject("coach").field("type", "string").field("index","no").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("state").field("type", "integer").field("index","no").endObject().startObject("cityId").field("type", "integer").endObject().startObject("history").field("type", "string").field("index","no").endObject().startObject("id").field("type", "integer").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("ticket").field("type", "string").field("index","no").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("aircraft").field("type", "string").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("train").field("type", "string").field("index","no").endObject().startObject("festival").field("type", "string").field("index","no").endObject().startObject("tips").field("type", "string").field("index","no").endObject().startObject("railTransit").field("type", "string").field("index","no").endObject().startObject("areaDist").field("type", "string").field("index","no").endObject().startObject("tourTime").field("type", "string").field("index","no").endObject().startObject("oldId").field("type", "integer").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeFoodDo", XContentFactory.jsonBuilder().startObject().startObject("lifeFoodDo").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("ingDetail").field("type", "string").field("index","no").endObject().startObject("author").field("type", "string").field("index","no").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("foodName").field("type", "string").field("index","no").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("image").field("type", "string").field("index","no").endObject().startObject("foodId").field("type", "integer").endObject().startObject("tips").field("type", "string").field("index","no").endObject().startObject("ing").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
    		builderMap.put("lifeArti", XContentFactory.jsonBuilder().startObject().startObject("lifeArti").startObject("properties").startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("typeId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("author").field("type", "string").field("index","no").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("publishTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("coverHeight").field("type", "integer").endObject().startObject("typeName").field("type", "string").field("index","no").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("coverWidth").field("type", "integer").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeSubject", XContentFactory.jsonBuilder().startObject().startObject("lifeSubject").startObject("properties").startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("sort").field("type", "integer").endObject().startObject("status").field("type", "integer").endObject().startObject("districtId").field("type", "integer").endObject().startObject("code").field("type", "string").field("index","not_analyzed").endObject().startObject("url").field("type", "string").field("index","no").endObject().startObject("typeId").field("type", "integer").endObject().startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("id").field("type", "integer").endObject().startObject("author").field("type", "string").field("index","no").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("districtName").field("type", "string").field("index","no").endObject().startObject("publishTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").endObject().startObject("coverHeight").field("type", "integer").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("typeName").field("type", "string").field("index","no").endObject().startObject("coverWidth").field("type", "integer").endObject().endObject().endObject().endObject());
//    		builderMap.put("sysLink", XContentFactory.jsonBuilder().startObject().startObject("sysLink").startObject("properties").startObject("position").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("logo").field("type", "string").field("index","no").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("url").field("type", "string").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeFarmstay", XContentFactory.jsonBuilder().startObject().startObject("lifeFarmstay").startObject("properties").startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("imgs").field("type", "string").field("index","no").endObject().startObject("phone").field("type", "string").field("index","not_analyzed").endObject().startObject("cityName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("categoryId").field("type", "integer").endObject().startObject("kindId").field("type", "integer").endObject().startObject("typeId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("cityId").field("type", "integer").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("provinceName").field("type", "string").field("index","no").endObject().startObject("categoryName").field("type", "string").field("index","no").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("address").field("type", "string").field("index","no").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("typeName").field("type", "string").field("index","no").endObject().startObject("scene").field("type", "string").field("index","no").endObject().startObject("kindName").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeImgs", XContentFactory.jsonBuilder().startObject().startObject("lifeImgs").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("height").field("type", "integer").field("index","no").endObject().startObject("categoryName").field("type", "string").field("index","no").endObject().startObject("targetName").field("type", "string").field("index","no").endObject().startObject("width").field("type", "integer").field("index","no").endObject().startObject("bigImg").field("type", "string").field("index","no").endObject().startObject("typeName").field("type", "string").field("index","no").endObject().startObject("categoryId").field("type", "integer").endObject().startObject("typeId").field("type", "integer").endObject().startObject("smallImg").field("type", "string").field("index","no").endObject().startObject("targetId").field("type", "integer").endObject().endObject().endObject().endObject());
//    		builderMap.put("lifeSaying", XContentFactory.jsonBuilder().startObject().startObject("lifeSaying").startObject("properties").startObject("typeName").field("type", "string").field("index","no").endObject().startObject("answer").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("conundrum").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("id").field("type", "integer").endObject().startObject("subtypeName").field("type", "string").field("index","no").endObject().startObject("subtypeId").field("type", "integer").endObject().startObject("typeId").field("type", "integer").endObject().endObject().endObject().endObject());
//
//    		builderMap.put("lifeFood", XContentFactory.jsonBuilder().startObject().startObject("lifeFood").startObject("properties").startObject("cityId").field("type", "integer").endObject().startObject("id").field("type", "integer").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("cityName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("provinceName").field("type", "string").field("index","no").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("createTime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("images").field("type", "string").field("index","no").endObject().startObject("kindId").field("type", "integer").endObject().startObject("kindName").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("schCelebrity", XContentFactory.jsonBuilder().startObject().startObject("lifeCelebrity").startObject("properties").startObject("cityId").field("type", "integer").endObject().startObject("summary").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("id").field("type", "integer").endObject().startObject("birthday").field("type", "string").field("index","not_analyzed").endObject().startObject("cityName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("title").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("deathday").field("type", "string").field("index","not_analyzed").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("dynasty").field("type", "string").field("index","not_analyzed").endObject().endObject().endObject().endObject());
//    		builderMap.put("schSchoolImg", XContentFactory.jsonBuilder().startObject().startObject("schSchoolImg").startObject("properties").startObject("imgUrl").field("type", "string").field("index","no").endObject().startObject("id").field("type", "integer").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("schoolId").field("type", "integer").endObject().endObject().endObject().endObject());
//    		builderMap.put("schComment", XContentFactory.jsonBuilder().startObject().startObject("schComment").startObject("properties").startObject("id").field("type", "integer").endObject().startObject("content").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("username").field("type", "string").field("index","not_analyzed").endObject().startObject("schoolName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("head").field("type", "string").field("index","no").endObject().startObject("schoolId").field("type", "integer").endObject().startObject("commentTime").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
//    		builderMap.put("schSchool", XContentFactory.jsonBuilder().startObject().startObject("schSchool").startObject("properties").startObject("scoreProfile").field("type", "string").field("index","no").endObject().startObject("scoreEducation").field("type", "string").field("index","no").endObject().startObject("cityName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("phone").field("type", "string").field("index","not_analyzed").endObject().startObject("sourceUrl").field("type", "string").field("index","no").endObject().startObject("natureName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("natureId").field("type", "integer").endObject().startObject("course").field("type", "string").field("index","no").endObject().startObject("cityId").field("type", "integer").endObject().startObject("createtime").field("type", "date").field("format","yyy-MM-dd HH:mm:ss||epoch_millis").field("index","no").endObject().startObject("id").field("type", "integer").endObject().startObject("cover").field("type", "string").field("index","no").endObject().startObject("scoreFood").field("type", "string").field("index","no").endObject().startObject("scoreCharge").field("type", "string").field("index","no").endObject().startObject("description").field("type", "string").field("index","no").endObject().startObject("commentHot").field("type", "string").field("index","no").endObject().startObject("coverHeight").field("type", "integer").endObject().startObject("name").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("scoreSociology").field("type", "string").field("index","no").endObject().startObject("tuition").field("type", "string").field("index","no").endObject().startObject("entranceSchoolId").field("type", "integer").field("index","no").endObject().startObject("scoreEquipment").field("type", "string").field("index","no").endObject().startObject("enrollment").field("type", "string").field("index","no").endObject().startObject("coverWidth").field("type", "integer").endObject().startObject("provinceId").field("type", "integer").endObject().startObject("website").field("type", "string").field("index","no").endObject().startObject("scoreOverall").field("type", "string").field("index","no").endObject().startObject("scoreEnv").field("type", "string").field("index","no").endObject().startObject("attr").field("type", "string").field("index","no").endObject().startObject("entranceSchoolName").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("code").field("type", "string").field("index","not_analyzed").endObject().startObject("scoreScale").field("type", "string").field("index","no").endObject().startObject("typeId").field("type", "integer").endObject().startObject("provinceName").field("type", "string").field("index","no").endObject().startObject("source").field("type", "string").field("index","analyzed").field("analyzer","ik_max_word").endObject().startObject("address").field("type", "string").field("index","no").endObject().startObject("scoreFaculty").field("type", "string").field("index","no").endObject().startObject("typeName").field("type", "string").field("index","no").endObject().startObject("scoreHealth").field("type", "string").field("index","no").endObject().endObject().endObject().endObject());
    		
    	} catch(Exception e) {
			e.printStackTrace();
		}
    	return builderMap;
    }
}
